<?php
include('config.inc.php');
$f=$_POST[f];
$sql = "select * from location order by location_id";
$result = mysql_query($sql);
if($f == 5){
echo "<span style='padding:10px 0px 10px 30px;'><small><b>จำนวนรายการต่อหน้า </b><select name='select_perpage'><option value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></small>";

echo "<div style='padding:5px 0px 5px 10px;'><input name='rd' type='radio' value='1' onClick=\"javascript:document.getElementById('but1').disabled = false;document.getElementById('but2').disabled = true;document.getElementById('locationcode').disabled = true;document.getElementById('ddlocat').disabled = false;\">";
echo "<small>กรุณาเลือก Location Code หรือสถานที่ : </small><select name='ddlocat' id='ddlocat'>";
while($a = mysql_fetch_array($result)){
	echo "<option value='$a[location_id]'>$a[location_id] : $a[site_name]</option>";
}
echo "</select> <input type='button' id='but1' onClick=\"javascript:getresult(document.getElementById('ddlocat').value,5,'',document.fsearch.select_perpage.value);\" value='ค้นหา' class='butsubmit' disabled='true'></div>";
echo "<div style='padding:5px 0px 5px 10px;'><input name='rd' type='radio' value='2' onClick=\"javascript:document.getElementById('but2').disabled = false;document.getElementById('but1').disabled = true;document.getElementById('locationcode').disabled = false;document.getElementById('ddlocat').disabled = true;\">";
echo "<small>กรุณาใส่ชื่อสถานที่ หรือ Location Code :<input name='locationcode' type='text' id='locationcode' value='' ></small>";
echo " <input type='button' id='but2' onClick=\"javascript:getresult(document.getElementById('locationcode').value,5,'',document.fsearch.select_perpage.value);\" value='ค้นหา' class='butsubmit' disabled='true'> * เช่น 14,1400,สืบศิริ,ปาก,กลางดง</div>";

}
?>

